package com.example.carbon.dao;

import com.example.carbon.pojo.DeviceData;
import com.example.carbon.pojo.daoo.DeviceSearch;
import com.example.carbon.pojo.dto.DeviceInfoSearch;
import com.example.carbon.pojo.dto.DeviceInfoSetData;
import com.example.carbon.pojo.dto.PageLimit;
import com.example.carbon.pojo.vo.DeviceShowData;
import com.example.carbon.server.info.DeviceServer;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface DeviceDataDao {
    int selectCountOfSearch(DeviceSearch deviceSearch);
    boolean updateInfo(DeviceInfoSetData data);

    @Select("select d_name as name,d_code as code,d_type as type, born_date_start as born_start_date,born_date_end as born_end_date,born_id,manufacturer,d_state as state ,demo from device_data where id =#{id}")
    DeviceInfoSetData selectDeviceInfoSettingById(int id);

    @Delete("delete from device_data where id=#{id}")
    boolean deleteInfoById(int id);

    List<DeviceShowData> selectDeviceInfoForSearch(DeviceSearch deviceServer,PageLimit pageLimit);

    boolean insertDeviceInfo(DeviceInfoSetData data);
}
